import type { BannerModel } from '../models/bannerModel';
import instance from '../utils/request';

interface data<T> {
	status: number;
	msg: string;
	data: T;
}

export const getBannerList = (): Promise<data<BannerModel[]>> => {
	return instance.get('/banner/list');
};

// 提交banner
export const addBannerList = (data: BannerModel): Promise<data<BannerModel>> => {
	return instance.post('/banner/save', data);
};

// 编辑banner
export const editBannerListApi = (data: BannerModel) => {
	return instance.put('/banner/update', data);
};
